package com.example.common.enums;

import lombok.AllArgsConstructor;

/**
 * @author Destinycc
 */
@AllArgsConstructor
public enum RequestLimitEnum {
    //
    PATH_LIMITER("pathKeyResolver", "此api调用过于频繁"),
    IP_LIMITER("ipKeyResolver", "此ip调用过于频繁")
    ;

    private String beanName;
    private String data;


    public static String getDataByBeanName(String beanName) {
        for (RequestLimitEnum value: RequestLimitEnum.values()){
            if (value.beanName.equals(beanName)){
                return value.data;
            }
        }
        return null;
    }
}
